﻿@model tutors_clus.ViewModel.Home_ViewModel
@{
    ViewBag.Title = "Trang chủ";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div id="cleft">
    <div id="slideshow">
        <p>Chào mừng bạn đến với website Câu lạc bộ gia sư Vietsoft</p>
        <p><img width="600" height="240" alt="" src="http://cdn.tgdd.vn/qcao/16_09_2013_08_05_45_TGDd-ThienDuongPhuKien-540x210.jpg" style="cursor:pointer"></p>
    </div>
    <div id="list-news" class="list">
        <div class="title"><p>Tin tức mới</p></div>
        <div class ="content">
           
               @foreach (var item in Model.news)
               {
                   <div class="news">
                       <div class="img_news">@if (item.image_news == "" || item.image_news == null)                                                 
	                    {
                              <img src="../Content/images/noimage.gif" alt="Alternate Text" style="width:100px;height:100px"/>                                  
		                    
	                    }
                        else
                        {
                             <img src="@item.image_news" alt="Alternate Text" style="width:100px;height:100px"/>   
                             
                        }
                       </div>                                          
                       <div class="title_news">@Html.ActionLink(@item.title_new, "Detail_News", new { id = item.id_new}) <i>(@Html.DisplayFor(m => item.create_date_new))</i></div>
                       <div class="detail_news"> @{if (item.detail_new.Length < 200) { @MvcHtmlString.Create(item.detail_new); } else { @MvcHtmlString.Create(item.detail_new.Substring(0, 200)); }}...</div>
                       <div class="readmore">@Html.ActionLink("xem tiếp", "Detail_News", new { id = item.id_new})</div>                      
                       <div class="line"></div>
                   </div>
                   
               }
        </div>
    </div>
    <div id="list-anno" class="list">
        <div class="title"><p>Thông báo mới</p></div>
        <div class ="content">
              @foreach (var item in Model.annoucements)
               {
                   <div class="news">
                       <div class="title_news">@Html.ActionLink(@item.title_ann, "Annoucement", new { id = item.id_ann}) <i>(@Html.DisplayFor(m => item.create_date_ann))</i></div>
                       <div class="detail_news"> @{if (item.detail_ann.Length < 200) { @MvcHtmlString.Create(item.detail_ann); } else { @MvcHtmlString.Create(item.detail_ann.Substring(0, 200)); }}...</div>
                       <div class="readmore">@Html.ActionLink("xem tiếp", "Annoucement", new { id = item.id_ann})</div>                      
                       <div class="line"></div>
                   </div>
                   
               } 
        </div>
    </div>
</div>
